<?php


class LocationRegle {
    public static function verifId($id_loc, Mypdo $db){
        $sql = 'SELECT * FROM location WHERE id_loc = :id_loc';
        $req = $db->prepare($sql);
        $req->bindValue(':id_loc', $id_loc, PDO::PARAM_INT);
        $req->execute();
        $res = $req->fetch(PDO::FETCH_ASSOC);
        if($res == false){
            throw new ImmolocException('L\'identifiant n\'existe pas');
        }
    }
} 